package sys.tests.logic;

import sys.message.*;
import sys.transport.*;
import sys.database.*;

public class Test2
{
    public static void startTest(String mailServer, String syscAddress, String DBHost, String DBName, String user, String pass)
    { 
/*        System.out.println("------------------------------------------------------------------");*/
        //System.out.println("Test2 : Adding two requests into database and reading them from it");
        //System.out.println("------------------------------------------------------------------");

        //DBWrapper dbw = new DBWrapper(DBHost, DBName, user, pass);
        //dbw.connect();
        //dbw.delete("Request", "ID = 0");
        //dbw.delete("Request", "ID = 1");
        //dbw.disconnect();

        //UniMessage mes = null; 
        //try
        //{
            //// Запрос на отметку заявки, как оплаченной 
            //mes = new JSONMessage("systema@localhost.localdomain", syscAddress, "LOGIC TEST 1");
            //mes.put("Type", "newRequest");
            //mes.put("ID", 0);
            //new MessageSenderSMTP(mailServer).send(mes);
            //Thread.sleep(2000);

            //mes = new JSONMessage("systema@localhost.localdomain", syscAddress, "LOGIC TEST 1");
            //mes.put("Type", "newRequest");
            //mes.put("ID", 1);
            //new MessageSenderSMTP(mailServer).send(mes);
            //Thread.sleep(2000);
           
            //// Запрос на получение информации о заявке
            //mes = new JSONMessage("systema@localhost.localdomain", syscAddress, "LOGIC TEST 1");
            //mes.put("Type", "payingStatus");
            //mes.put("AskAboutID", 0);
            //new MessageSenderSMTP(mailServer).send(mes);

            //mes = new JSONMessage("systema@localhost.localdomain", syscAddress, "LOGIC TEST 1");
            //mes.put("Type", "payingStatus");
            //mes.put("AskAboutID", 1);
            //new MessageSenderSMTP(mailServer).send(mes);

            //Thread.sleep(10000);
        //}
        //catch (Exception e)
        //{
            //System.out.println("Test1: Something wrong " + e.getMessage());
        /*}*/
    }
}
